import http from '~/api/request';

export const article = {


    getDetail(id: string): Promise<ApiResponse> {
        return http.get("/article/blog/get/" + id)
    },

    getList(index: number, size: number, params: any): Promise<ApiResponse> {
        params.index = index
        params.size = size
        return http.post("/article/blog/list", params)
    },

    getTags(): Promise<ApiResponse> {
        return http.get("/article/blog/top20Tag")
    },

    postArticle(params: any): Promise<ApiResponse> {
        return http.post("/user/article", params)
    },
    
    updateArticle(params: any): Promise<ApiResponse> {
        return http.put("/user/article", params)
    },

    getUserList(page: number, size: number, category: string): Promise<ApiResponse> {
        let c = category ? category + "/" : "";
        return http.get("/user/article/list/" + c + page + "/" + size)
    },

}